Feature: Administrator Capabilities
  Handles account and privileges administration.

  Scenario: Promote To Administrator Successfully
    Given i am an administrator
    And foo is an user
    When i click on the "Promote foo To Administrator" button
    Then foo should be an administrator
    And the system should send foo a notification alert "You have been promoted to administrator"

  Scenario: Cannot Promote To Administrator Too Young Users
    Given i am an administrator
    And foo is an user
    When i click on the "Promote foo To Administer" button
    But foo is too young
    Then the system should send me a notification alert "foo is too young; you can't promote him to administrator yet"

  Scenario: Cannot Promote To Administrator Demoted Users
    Given i am an administrator
    And foo is an user
    When i click on the "Promote foo To Administer" button
    But foo has been demoted
    Then the system should send me an error alert "foo has been demoted; nobody can promote him"

  Scenario: Demote Administrator
    Given i am a super user
    And foo is an administrator
    When i click on the "Demote foo" button
    And i confirm on the messagebox
    Then foo should not be an administrator anymore
    And foo should be demoted
    And the system should send me a notification alert "foo has been demoted"
    And the system should send foo a notification alert "You have been demoted"

  Scenario: Force Account Activation
    Given i am a super user
    And foo has registered an account
    But foo's account has not been activated
    When i click on the "Activate foo's account" button
    And i confirm on the messagebox
    Then foo's account should be activated
    And the system should send me a notification alert "foo's account has been activated"
    And the system should send foo a welcome e-mail

  Scenario: Super User Deletes Account
    Given i am a super user
    And foo is not a super user
    When i click on the "Delete foo's account" button
    And i confirm on the messagebox
    Then foo's account should not exist
    And the system should send an "Account Deleted" e-mail to foo

  Scenario: Force User Password Change
    Given i am a super user
    And foo is an user
    And i want to force foo's password change
    When i fill out the new password form with dummy password
    And i click on the "Force password change" button
    Then foo's passoword should be dummy
    And the system should send me a notification alert "foo's password changed"

  Scenario: Force Username Change
    Given i am a super user
    And foo is an user
    And bar is foo's username
    And dummy username is not taken
    When i want to change foo's username
    And i fill out the new username form with dummy username
    And i click on the "Force username update" button
    Then foo's username should be dummy
    And the system should send me a notification alert "foo's name changed to dummy"


